/**  
 * All rights Reserved, Designed By <a href="www.itttq.com" target="_blank">www.itttq.com</a>
 * @date:   2017-07-21 11:42:21
 * @Copyright: 2017 <a href="www.itttq.com" target="_blank">www.itttq.com</a> Inc. All rights reserved. 
 */
package com.itttq.gshop.pbpm.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.itttq.gshop.domain.po.SysLogsPo;
import com.itttq.gshop.domain.to.ResultPageTo;
import com.itttq.gshop.pbpm.mapper.ISysLogsMapper;

@Service
public class SysLogsService {
	@Autowired
	private ISysLogsMapper sysLogsMapper;
	
	/**
	 * 根据ID获取SysLogsPo对象
	 * 
	 * @param id
	 * @return
	 * @Author 迷蝶
	 * @return SysLogsPo
	 */
	public SysLogsPo getSysLogs(int id) {
		return sysLogsMapper.findSysLogsById(id);
	}
	
	/**
	 * 根据条件获取SysLogsPo对象，并返回查询的数据总数
	 * 
	 * @param sysLogs
	 * @Author 迷蝶
	 * @return ResultPageTo<SysLogsPo>
	 */
	public ResultPageTo<SysLogsPo> getSysLogss(SysLogsPo sysLogs) {
		return new ResultPageTo<SysLogsPo>(sysLogs.getStart(), sysLogs.getSize(), 
				sysLogsMapper.findSysLogsCount(sysLogs), sysLogsMapper.findSysLogss(sysLogs));
	}
	
	/**
	 * 根据ID删除SysLogsPo对象
	 * 
	 * @param id
	 * @Author 迷蝶
	 */
	public Integer delSysLogs(int id) {
		return sysLogsMapper.delSysLogsById(id);
	}
	
	/**
	 * 增加SysLogsPo对象
	 * 
	 * @param sysLogs
	 * @Author 迷蝶
	 */
	public Integer addSysLogs(SysLogsPo sysLogs) {
		return sysLogsMapper.addSysLogs(sysLogs);
	}
	
	/**
	 * 根据条件更新SysLogsPo对象
	 * 
	 * @param sysLogs
	 * @Author 迷蝶
	 */
	public Integer updateSysLogs(SysLogsPo sysLogs) {
		return sysLogsMapper.updateSysLogs(sysLogs);
	}
	
}
